﻿app.service("panelService", ["$http", function ($http) {
    this.load = function(panelName) {
        var url = "/dashboard/panel/";

        if (panelName != null)
            url += panelName;

        return $http.get(url);
    };

    this.list = function() {
        var url = "/dashboard/panel/list";
        return $http.get(url);
    };

    this.getWidgets = function(panelId) {
        var url = "/dashboard/panel/" + panelId + "/widgets";
        return $http.get(url);
    };

}]);